﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TestWebApplication.CommerceAccount;
using TestWebApplication.CommercePaymentInstrument;
using TestWebApplication.CommerceTransaction;
using System.Security;
using System.Security.Cryptography.X509Certificates;

namespace TestWebApplication
{
    public class AdapterFactory
    {

        public static CommerceAccountServiceAdapter createAccountServiceAdapter()
        {
            string serviceUrl = ServiceSettings.CommerceAccountServiceUrl;
            X509Certificate2 cert = ServiceSettings.cert;
            CommerceAccountServiceAdapter adapter = new CommerceAccountServiceAdapter(serviceUrl, cert);

            return adapter;
        }

        public static CommercePaymentInstrumentServiceAdapter createPaymentInstrumentServiceAdapter()
        {
            string serviceUrl = ServiceSettings.CommercePaymentInstrumentUrl;
            X509Certificate2 cert = ServiceSettings.cert;
            string password = ServiceSettings.Password;
            CommercePaymentInstrumentServiceAdapter adapter = new CommercePaymentInstrumentServiceAdapter(serviceUrl, cert);

            return adapter;
        }

        public static CommerceTransactionServiceAdapter createTransactionServiceAdapter()
        {
            string serviceUrl = ServiceSettings.CommerceTransactionUrl;
            X509Certificate2 cert = ServiceSettings.cert;
            string password = ServiceSettings.Password;
            CommerceTransactionServiceAdapter adapter = new CommerceTransactionServiceAdapter(serviceUrl, cert);

            return adapter;
        }

    


    }
}